package cn.iocoder.yudao.module.nmkj.dal.mysql.useraccess;

import java.util.*;

import cn.iocoder.yudao.framework.common.pojo.PageResult;
import cn.iocoder.yudao.framework.mybatis.core.query.LambdaQueryWrapperX;
import cn.iocoder.yudao.framework.mybatis.core.mapper.BaseMapperX;
import cn.iocoder.yudao.module.nmkj.dal.dataobject.useraccess.UserAccessDO;
import org.apache.ibatis.annotations.Mapper;
import cn.iocoder.yudao.module.nmkj.controller.admin.useraccess.vo.*;

/**
 * 访客消息 Mapper
 *
 * @author 芋道源码
 */
@Mapper
public interface UserAccessMapper extends BaseMapperX<UserAccessDO> {

    default PageResult<UserAccessDO> selectPage(UserAccessPageReqVO reqVO) {
        return selectPage(reqVO, new LambdaQueryWrapperX<UserAccessDO>()
                .likeIfPresent(UserAccessDO::getName, reqVO.getName())
                .eqIfPresent(UserAccessDO::getPhone, reqVO.getPhone())
                .eqIfPresent(UserAccessDO::getAddress, reqVO.getAddress())
                .eqIfPresent(UserAccessDO::getContent, reqVO.getContent())
                .eqIfPresent(UserAccessDO::getStatus, reqVO.getStatus())
                .betweenIfPresent(UserAccessDO::getCreateTime, reqVO.getCreateTime())
                .orderByAsc(UserAccessDO::getStatus)
                .orderByAsc(UserAccessDO::getCreateTime));
    }

}